package org.example.testone.constant;


/**
 * @Author: MoChen
 * @Description: http状态码
 * @Date: 2022/3/11 16:32
 */

public enum HttpStatusCode {

    // 200
    OK(200, "请求成功"),

    // 400
    BAD_REQUEST(400, "请求参数错误"),
    UNAUTHORIZED(401, "token不存在或过期"),

    // 500
    SERVER_ERROR(500, "服务器异常"),

    // 1000 - 用户状态码
    USER_NOT_EXIST(1000, "用户不存在"),

    // 9999
    NOT(9999, "该状态码不会使用");

    private final int code;
    private final String message;

    HttpStatusCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
